package vip.huhaiong.hlfood.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import vip.huhaiong.hlfood.pojo.Rs;
import vip.huhaiong.hlfood.service.FoodHeatService;

/**
 * @program: hlfood
 * @description: 食物热量控制类
 * @author: 胡海龙
 * @create: 2021-07-09 21:52:08
 **/
@RestController
@RequestMapping("/foodHeat")
public class FoodHeatController {

    FoodHeatService foodHeatService;

    @Autowired
    public FoodHeatController(FoodHeatService foodHeatService){
        this.foodHeatService = foodHeatService;
    }

    @GetMapping("/list")
    public Rs list(String foodName) throws Exception {
        return foodHeatService.searchFoodHeat(foodName);
    }

    @GetMapping("/detail")
    public Rs detail(String detailUrl) throws Exception {
        return foodHeatService.searchFoodHeatDetail(detailUrl);
    }
}
